using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._RelationshipClasses
{
    /// <summary>
    /// <para>Create Relationship Class</para>
    /// <para>This tool creates a relationship class to store an association between fields or features in the origin table and the destination table.</para>
    /// <para>此工具将创建一个关系类，用于存储源表和目标表中的字段或要素之间的关联。</para>
    /// </summary>    
    [DisplayName("Create Relationship Class")]
    public class CreateRelationshipClass : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateRelationshipClass()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_origin_table">
        /// <para>Origin Table</para>
        /// <para>The table or feature class that is associated to the destination table.</para>
        /// <para>与目标表关联的表或要素类。</para>
        /// </param>
        /// <param name="_destination_table">
        /// <para>Destination Table</para>
        /// <para>The table that is associated to the origin table.</para>
        /// <para>与源表关联的表。</para>
        /// </param>
        /// <param name="_out_relationship_class">
        /// <para>Output Relationship Class</para>
        /// <para>The relationship class that is created.</para>
        /// <para>创建的关系类。</para>
        /// </param>
        /// <param name="_relationship_type">
        /// <para>Relationship Type</para>
        /// <para><xdoc>
        ///   <para>The type of relationship to create between the origin and destination tables.</para>
        ///   <bulletList>
        ///     <bullet_item>Simple—A relationship between independent objects (parent to parent). This is the default.</bullet_item><para/>
        ///     <bullet_item>Composite—A relationship between dependent objects where the lifetime of one object controls the lifetime of the related object (parent to child).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要在源表和目标表之间创建的关系类型。</para>
        ///   <bulletList>
        ///     <bullet_item>简单 （Simple） - 独立对象（父对象到父对象）之间的关系。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>复合 - 从属对象之间的关系，其中一个对象的生存期控制相关对象（父对象到子对象）的生存期。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_forward_label">
        /// <para>Forward Path Label</para>
        /// <para>A name to uniquely identify the relationship when navigating from the origin table to the destination table.</para>
        /// <para>在从源表导航到目标表时唯一标识关系的名称。</para>
        /// </param>
        /// <param name="_backward_label">
        /// <para>Backward Path label</para>
        /// <para>A name to uniquely identify the relationship when navigating from the destination table to the origin table.</para>
        /// <para>在从目标表导航到源表时唯一标识关系的名称。</para>
        /// </param>
        /// <param name="_message_direction">
        /// <para>Message Direction</para>
        /// <para><xdoc>
        ///   <para>The direction in which messages are passed between the origin and destination tables. For example, in a relationship between poles and transformers, when the pole is deleted, it sends a message to its related transformer objects informing them it was deleted.</para>
        ///   <bulletList>
        ///     <bullet_item>Forward (origin to destination)—Messages are passed from the origin to the destination table.</bullet_item><para/>
        ///     <bullet_item>Backward (destination to origin)—Messages are passed from the destination to the origin table.</bullet_item><para/>
        ///     <bullet_item>Both directions—Messages are passed from the origin to the destination table and from the destination to the origin table.</bullet_item><para/>
        ///     <bullet_item>None (no messages propagated)—No messages passed. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>消息在源表和目标表之间传递的方向。例如，在电线杆和变压器之间的关系中，当电线杆被删除时，它会向其相关的变压器对象发送一条消息，通知它们已被删除。</para>
        ///   <bulletList>
        ///     <bullet_item>转发（源到目标）- 消息从源传递到目标表。</bullet_item><para/>
        ///     <bullet_item>向后（目标到源）- 消息从目标传递到源表。</bullet_item><para/>
        ///     <bullet_item>双向 - 消息从源传递到目标表，再从目标传递到源表。</bullet_item><para/>
        ///     <bullet_item>无（无消息传播）- 未传递消息。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_cardinality">
        /// <para>Cardinality</para>
        /// <para><xdoc>
        ///   <para>Determines how many relationships exist between rows or features in the origin and rows or features in the destination table.</para>
        ///   <bulletList>
        ///     <bullet_item>One to one (1:1)—Each row or feature in the origin table can be related to zero or one row or feature in the destination table. This is the default.</bullet_item><para/>
        ///     <bullet_item>One to many (1:M)—Each row or feature in the origin table can be related to one or several rows or features in the destination table.</bullet_item><para/>
        ///     <bullet_item>Many to many (M:N)—Several fields or features in the origin table can be related to one or several rows or features in the destination table.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定原点中的行或要素与目标表中的行或要素之间存在多少种关系。</para>
        ///   <bulletList>
        ///     <bullet_item>一对一 （1：1） - 源表中的每一行或每一要素都可以与目标表中的零或一行或要素相关。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>一对多 （1：M） - 源表中的每行或要素都可以与目标表中的一行或多行或要素相关。</bullet_item><para/>
        ///     <bullet_item>多对多 （M：N） - 源表中的多个字段或要素可以与目标表中的一行或多行或要素相关。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_attributed">
        /// <para>Relationship class is attributed</para>
        /// <para><xdoc>
        ///   <para>Specifies if the relationship will have attributes.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Indicates the relationship class will have attributes.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Indicates the relationship class will not have attributes. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定关系是否具有属性。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 指示关系类将具有属性。</bullet_item><para/>
        ///     <bullet_item>未选中 （Unchecked） - 指示关系类将不具有属性。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_origin_primary_key">
        /// <para>Origin Primary Key</para>
        /// <para>The field in the origin table, typically the OID field, that links it to the Origin Foreign Key field in the relationship class table.</para>
        /// <para>源表中的字段（通常为 OID 字段），用于将其链接到关系类表中的“源外键”字段。</para>
        /// </param>
        /// <param name="_origin_foreign_key">
        /// <para>Origin Foreign Key</para>
        /// <para>The field in the relationship class table that links it to the Origin Primary Key field in the origin table.</para>
        /// <para>关系类表中将其链接到源表中的“源主键”字段的字段。</para>
        /// </param>
        public CreateRelationshipClass(object _origin_table, object _destination_table, object _out_relationship_class, _relationship_type_value _relationship_type, object _forward_label, object _backward_label, _message_direction_value _message_direction, _cardinality_value _cardinality, _attributed_value _attributed, object _origin_primary_key, object _origin_foreign_key)
        {
            this._origin_table = _origin_table;
            this._destination_table = _destination_table;
            this._out_relationship_class = _out_relationship_class;
            this._relationship_type = _relationship_type;
            this._forward_label = _forward_label;
            this._backward_label = _backward_label;
            this._message_direction = _message_direction;
            this._cardinality = _cardinality;
            this._attributed = _attributed;
            this._origin_primary_key = _origin_primary_key;
            this._origin_foreign_key = _origin_foreign_key;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create Relationship Class";

        public override string CallName => "management.CreateRelationshipClass";

        public override List<string> AcceptEnvironments => ["autoCommit", "workspace"];

        public override object[] ParameterInfo => [_origin_table, _destination_table, _out_relationship_class, _relationship_type.GetGPValue(), _forward_label, _backward_label, _message_direction.GetGPValue(), _cardinality.GetGPValue(), _attributed.GetGPValue(), _origin_primary_key, _origin_foreign_key, _destination_primary_key, _destination_foreign_key];

        /// <summary>
        /// <para>Origin Table</para>
        /// <para>The table or feature class that is associated to the destination table.</para>
        /// <para>与目标表关联的表或要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Origin Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _origin_table { get; set; }


        /// <summary>
        /// <para>Destination Table</para>
        /// <para>The table that is associated to the origin table.</para>
        /// <para>与源表关联的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _destination_table { get; set; }


        /// <summary>
        /// <para>Output Relationship Class</para>
        /// <para>The relationship class that is created.</para>
        /// <para>创建的关系类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Relationship Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_relationship_class { get; set; }


        /// <summary>
        /// <para>Relationship Type</para>
        /// <para><xdoc>
        ///   <para>The type of relationship to create between the origin and destination tables.</para>
        ///   <bulletList>
        ///     <bullet_item>Simple—A relationship between independent objects (parent to parent). This is the default.</bullet_item><para/>
        ///     <bullet_item>Composite—A relationship between dependent objects where the lifetime of one object controls the lifetime of the related object (parent to child).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要在源表和目标表之间创建的关系类型。</para>
        ///   <bulletList>
        ///     <bullet_item>简单 （Simple） - 独立对象（父对象到父对象）之间的关系。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>复合 - 从属对象之间的关系，其中一个对象的生存期控制相关对象（父对象到子对象）的生存期。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Relationship Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _relationship_type_value _relationship_type { get; set; }

        public enum _relationship_type_value
        {
            /// <summary>
            /// <para>Simple</para>
            /// <para>Simple—A relationship between independent objects (parent to parent). This is the default.</para>
            /// <para>简单 （Simple） - 独立对象（父对象到父对象）之间的关系。这是默认设置。</para>
            /// </summary>
            [Description("Simple")]
            [GPEnumValue("SIMPLE")]
            _SIMPLE,

            /// <summary>
            /// <para>Composite</para>
            /// <para>Composite—A relationship between dependent objects where the lifetime of one object controls the lifetime of the related object (parent to child).</para>
            /// <para>复合 - 从属对象之间的关系，其中一个对象的生存期控制相关对象（父对象到子对象）的生存期。</para>
            /// </summary>
            [Description("Composite")]
            [GPEnumValue("COMPOSITE")]
            _COMPOSITE,

        }

        /// <summary>
        /// <para>Forward Path Label</para>
        /// <para>A name to uniquely identify the relationship when navigating from the origin table to the destination table.</para>
        /// <para>在从源表导航到目标表时唯一标识关系的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Forward Path Label")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _forward_label { get; set; }


        /// <summary>
        /// <para>Backward Path label</para>
        /// <para>A name to uniquely identify the relationship when navigating from the destination table to the origin table.</para>
        /// <para>在从目标表导航到源表时唯一标识关系的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Backward Path label")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _backward_label { get; set; }


        /// <summary>
        /// <para>Message Direction</para>
        /// <para><xdoc>
        ///   <para>The direction in which messages are passed between the origin and destination tables. For example, in a relationship between poles and transformers, when the pole is deleted, it sends a message to its related transformer objects informing them it was deleted.</para>
        ///   <bulletList>
        ///     <bullet_item>Forward (origin to destination)—Messages are passed from the origin to the destination table.</bullet_item><para/>
        ///     <bullet_item>Backward (destination to origin)—Messages are passed from the destination to the origin table.</bullet_item><para/>
        ///     <bullet_item>Both directions—Messages are passed from the origin to the destination table and from the destination to the origin table.</bullet_item><para/>
        ///     <bullet_item>None (no messages propagated)—No messages passed. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>消息在源表和目标表之间传递的方向。例如，在电线杆和变压器之间的关系中，当电线杆被删除时，它会向其相关的变压器对象发送一条消息，通知它们已被删除。</para>
        ///   <bulletList>
        ///     <bullet_item>转发（源到目标）- 消息从源传递到目标表。</bullet_item><para/>
        ///     <bullet_item>向后（目标到源）- 消息从目标传递到源表。</bullet_item><para/>
        ///     <bullet_item>双向 - 消息从源传递到目标表，再从目标传递到源表。</bullet_item><para/>
        ///     <bullet_item>无（无消息传播）- 未传递消息。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Message Direction")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _message_direction_value _message_direction { get; set; }

        public enum _message_direction_value
        {
            /// <summary>
            /// <para>Forward (origin to destination)</para>
            /// <para>Forward (origin to destination)—Messages are passed from the origin to the destination table.</para>
            /// <para>转发（源到目标）- 消息从源传递到目标表。</para>
            /// </summary>
            [Description("Forward (origin to destination)")]
            [GPEnumValue("FORWARD")]
            _FORWARD,

            /// <summary>
            /// <para>Backward (destination to origin)</para>
            /// <para>Backward (destination to origin)—Messages are passed from the destination to the origin table.</para>
            /// <para>向后（目标到源）- 消息从目标传递到源表。</para>
            /// </summary>
            [Description("Backward (destination to origin)")]
            [GPEnumValue("BACKWARD")]
            _BACKWARD,

            /// <summary>
            /// <para>Both directions</para>
            /// <para>Both directions—Messages are passed from the origin to the destination table and from the destination to the origin table.</para>
            /// <para>双向 - 消息从源传递到目标表，再从目标传递到源表。</para>
            /// </summary>
            [Description("Both directions")]
            [GPEnumValue("BOTH")]
            _BOTH,

            /// <summary>
            /// <para>None (no messages propagated)</para>
            /// <para>None (no messages propagated)—No messages passed. This is the default.</para>
            /// <para>无（无消息传播）- 未传递消息。这是默认设置。</para>
            /// </summary>
            [Description("None (no messages propagated)")]
            [GPEnumValue("NONE")]
            _NONE,

        }

        /// <summary>
        /// <para>Cardinality</para>
        /// <para><xdoc>
        ///   <para>Determines how many relationships exist between rows or features in the origin and rows or features in the destination table.</para>
        ///   <bulletList>
        ///     <bullet_item>One to one (1:1)—Each row or feature in the origin table can be related to zero or one row or feature in the destination table. This is the default.</bullet_item><para/>
        ///     <bullet_item>One to many (1:M)—Each row or feature in the origin table can be related to one or several rows or features in the destination table.</bullet_item><para/>
        ///     <bullet_item>Many to many (M:N)—Several fields or features in the origin table can be related to one or several rows or features in the destination table.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定原点中的行或要素与目标表中的行或要素之间存在多少种关系。</para>
        ///   <bulletList>
        ///     <bullet_item>一对一 （1：1） - 源表中的每一行或每一要素都可以与目标表中的零或一行或要素相关。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>一对多 （1：M） - 源表中的每行或要素都可以与目标表中的一行或多行或要素相关。</bullet_item><para/>
        ///     <bullet_item>多对多 （M：N） - 源表中的多个字段或要素可以与目标表中的一行或多行或要素相关。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Cardinality")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _cardinality_value _cardinality { get; set; }

        public enum _cardinality_value
        {
            /// <summary>
            /// <para>One to one (1:1)</para>
            /// <para>One to one (1:1)—Each row or feature in the origin table can be related to zero or one row or feature in the destination table. This is the default.</para>
            /// <para>一对一 （1：1） - 源表中的每一行或每一要素都可以与目标表中的零或一行或要素相关。这是默认设置。</para>
            /// </summary>
            [Description("One to one (1:1)")]
            [GPEnumValue("ONE_TO_ONE")]
            _ONE_TO_ONE,

            /// <summary>
            /// <para>One to many (1:M)</para>
            /// <para>One to many (1:M)—Each row or feature in the origin table can be related to one or several rows or features in the destination table.</para>
            /// <para>一对多 （1：M） - 源表中的每行或要素都可以与目标表中的一行或多行或要素相关。</para>
            /// </summary>
            [Description("One to many (1:M)")]
            [GPEnumValue("ONE_TO_MANY")]
            _ONE_TO_MANY,

            /// <summary>
            /// <para>Many to many (M:N)</para>
            /// <para>Many to many (M:N)—Several fields or features in the origin table can be related to one or several rows or features in the destination table.</para>
            /// <para>多对多 （M：N） - 源表中的多个字段或要素可以与目标表中的一行或多行或要素相关。</para>
            /// </summary>
            [Description("Many to many (M:N)")]
            [GPEnumValue("MANY_TO_MANY")]
            _MANY_TO_MANY,

        }

        /// <summary>
        /// <para>Relationship class is attributed</para>
        /// <para><xdoc>
        ///   <para>Specifies if the relationship will have attributes.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Indicates the relationship class will have attributes.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Indicates the relationship class will not have attributes. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定关系是否具有属性。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 指示关系类将具有属性。</bullet_item><para/>
        ///     <bullet_item>未选中 （Unchecked） - 指示关系类将不具有属性。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Relationship class is attributed")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _attributed_value _attributed { get; set; }

        public enum _attributed_value
        {
            /// <summary>
            /// <para>ATTRIBUTED</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ATTRIBUTED")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NONE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NONE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Origin Primary Key</para>
        /// <para>The field in the origin table, typically the OID field, that links it to the Origin Foreign Key field in the relationship class table.</para>
        /// <para>源表中的字段（通常为 OID 字段），用于将其链接到关系类表中的“源外键”字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Origin Primary Key")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _origin_primary_key { get; set; }


        /// <summary>
        /// <para>Origin Foreign Key</para>
        /// <para>The field in the relationship class table that links it to the Origin Primary Key field in the origin table.</para>
        /// <para>关系类表中将其链接到源表中的“源主键”字段的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Origin Foreign Key")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _origin_foreign_key { get; set; }


        /// <summary>
        /// <para>Destination Primary Key</para>
        /// <para>The field in the destination table, typically the OID field, that links it to the Destination Foreign Key field in the relationship class table.</para>
        /// <para>目标表中的字段（通常为 OID 字段），用于将其链接到关系类表中的“目标外键”字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination Primary Key")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destination_primary_key { get; set; } = null;


        /// <summary>
        /// <para>Destination Foreign Key</para>
        /// <para>The field in the relationship class table that links it to the Destination Primary Key field in the destination table.</para>
        /// <para>关系类表中将其链接到目标表中的“目标主键”字段的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination Foreign Key")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destination_foreign_key { get; set; } = null;


        public CreateRelationshipClass SetEnv(int? autoCommit = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, workspace: workspace);
            return this;
        }

    }

}